var mySwiper = new Swiper('.swiper-container', {
  direction: 'horizontal',
  loop: true, // 循环模式选项
  autoplay: {
    disableOnInteraction: false,
  },

  // 如果需要分页器
  pagination: {
    el: '.swiper-pagination',
  },
  type: 'progressbar',
  clickable: true,

  // 如果需要前进后退按钮
  navigation: {
    nextEl: '.swiper-button-next',
    prevEl: '.swiper-button-prev',
  },

})


//如果你在swiper初始化后才决定使用clickable，可以这样设置
mySwiper.params.pagination.clickable = true;
//此外还需要重新初始化pagination
mySwiper.pagination.destroy()
mySwiper.pagination.init()
mySwiper.pagination.bullets.eq(0).addClass('swiper-pagination-bullet-active');
mySwiper.el.onmouseover = function () {
  mySwiper.navigation.$nextEl.removeClass('hide');
  mySwiper.navigation.$prevEl.removeClass('hide');
}
mySwiper.el.onmouseout = function () {
  mySwiper.navigation.$nextEl.addClass('hide');
  mySwiper.navigation.$prevEl.addClass('hide');
}